package com.proxy;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

import java.lang.reflect.Proxy;


@Component
@Aspect
public class Vhrproxy {
    @Before(value = "execution(* com.service.impl.ServiceImpl.findAll(..))")
    public void before(){
        System.out.println("前置增强");
    }

    @AfterReturning(value = "execution(* com.service.impl.ServiceImpl.findAll(..))")
    public void after(){
        System.out.println("最终增强");
    }

    @AfterReturning(value = "execution(* com.service.impl.ServiceImpl.findAll(..))")
    public void AfterReturning(){
        System.out.println("后置增强");
    }

}
